# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Solar.V1.Model.RoofSegmentSummary do
  @moduledoc """
  Information about a roof segment on the building, with some number of panels placed on it.

  ## Attributes

  *   `azimuthDegrees` (*type:* `number()`, *default:* `nil`) - Compass direction the roof segment is pointing in. 0 = North, 90 = East, 180 = South. For a "flat" roof segment (`pitch_degrees` very near 0), azimuth is not well defined, so for consistency, we define it arbitrarily to be 0 (North).
  *   `panelsCount` (*type:* `integer()`, *default:* `nil`) - The total number of panels on this segment.
  *   `pitchDegrees` (*type:* `number()`, *default:* `nil`) - Angle of the roof segment relative to the theoretical ground plane. 0 = parallel to the ground, 90 = perpendicular to the ground.
  *   `segmentIndex` (*type:* `integer()`, *default:* `nil`) - Index in roof_segment_stats of the corresponding `RoofSegmentSizeAndSunshineStats`.
  *   `yearlyEnergyDcKwh` (*type:* `number()`, *default:* `nil`) - How much sunlight energy this part of the layout captures over the course of a year, in DC kWh, assuming the panels described above.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :azimuthDegrees => number() | nil,
          :panelsCount => integer() | nil,
          :pitchDegrees => number() | nil,
          :segmentIndex => integer() | nil,
          :yearlyEnergyDcKwh => number() | nil
        }

  field(:azimuthDegrees)
  field(:panelsCount)
  field(:pitchDegrees)
  field(:segmentIndex)
  field(:yearlyEnergyDcKwh)
end

defimpl Poison.Decoder, for: GoogleApi.Solar.V1.Model.RoofSegmentSummary do
  def decode(value, options) do
    GoogleApi.Solar.V1.Model.RoofSegmentSummary.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Solar.V1.Model.RoofSegmentSummary do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
